Since priv->device gets set to NULL inside st_button_release, ungrab the
input device before calling st_button_release and avoid
clutter_input_device_ungrab failing with a critical error.
This fixes a regression introduced with
d5a1a888d91b9456632a8393cf14c443e6df6a5b
While at it, also remove the superfluous line resetting priv->device to
NULL and move the check for priv->grabbed into an elseif block since
there should be no case where StButton has both grabs at the same time.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/614
clutter_input_device_sequence_ungrab (priv->device,
priv->press_sequence);
}
-
- if (priv->pressed || priv->press_sequence)
- st_button_release (button, priv->device,
- priv->pressed, 0, NULL);
-
- if (priv->grabbed)
+ else if (priv->grabbed)
{
priv->grabbed = 0;
clutter_input_device_ungrab (priv->device);
}
- priv->device = NULL;
+ if (priv->pressed || priv->press_sequence)
+ st_button_release (button, priv->device,
+ priv->pressed, 0, NULL);
}
/******************************************************************************/